package com.ruoyi.agreement.mapper;

import com.ruoyi.agreement.domain.Agreement;
import com.ruoyi.agreement.domain.Result;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface AgreementMapper {
    @Insert("insert into credit(user_information_info_code,num,create_time,update_time) values (#{userInformationInfoCode},#{num},#{createTime},#{updateTime})")
    void addAgreement(Agreement agreement);

    @Select("select num from credit where user_information_info_code=#{code}")
    Agreement getAgreement(String code);

    @Update("update credit set num=(num-#{downMoney}) where user_information_info_code = #{userInformationInfoCode}")
    void upAgreement(Agreement agreement);
}
